import { createRouter, createWebHistory } from 'vue-router';
import Login from '@/views/Login.vue';
import Main from '@/views/Main.vue';
import UserInfo from '@/views/UserInfo.vue';
import Register from '@/views/Register.vue';
import RoleManage from '@/views/RoleManage.vue';
import EquipmentManage from '@/views/EquipmentManage.vue';
import TaskManage from '@/views/TaskManage.vue';
import PlayerManage from '@/views/PlayerManage.vue';
import PlayerFeedbackManage from '@/views/PlayerFeedbackManage.vue';
import GuildManage from '@/views/GuildManage.vue';
import GuildMemberManage from '@/views/GuildMemberManage.vue';
import GuildNoticeManage from '@/views/GuildNoticeManage.vue';
import GuildActivityManage from '@/views/GuildActivityManage.vue';
import GuildContributionManage from '@/views/GuildContributionManage.vue';
import GuildDiplomacyManage from '@/views/GuildDiplomacyManage.vue';
import WorkOrderManage from '@/views/WorkOrderManage.vue'; // 导入工单管理组件
import KnowledgeBaseManage from '@/views/KnowledgeBaseManage.vue'; // 导入知识库管理组件
import PlayerCompensationManage from '@/views/PlayerCompensationManage.vue'; // 玩家补偿管理页面
import PlayerBan from '@/views/PlayerBan.vue';

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      children: [
        {
          path: 'user-info',
          name: 'user-info',
          component: UserInfo
        },
        {
          path: 'role-manage',
          name: 'role-manage',
          component: RoleManage
        },
        {
          path: 'equipment-manage',
          name: 'equipment-manage',
          component: EquipmentManage
        },
        {
          path: 'task-manage',
          name: 'task-manage',
          component: TaskManage
        },
        {
          path: 'player-manage',
          name: 'player-manage',
          component: PlayerManage
        },
        {
          path: 'player-feedback-manage',
          name: 'player-feedback-manage',
          component: PlayerFeedbackManage
        },
        {
          path: 'guild-manage',
          name: 'guild-manage',
          component: GuildManage
        },
        {
          path: 'guild-member-manage',
          name: 'guild-member-manage',
          component: GuildMemberManage
        },
        {
          path: 'guild-notice-manage',
          name: 'guild-notice-manage',
          component: GuildNoticeManage
        },
        {
          path: 'guild-activity-manage',
          name: 'guild-activity-manage',
          component: GuildActivityManage
        },
        {
          path: 'guild-contribution-manage',
          name: 'guild-contribution-manage',
          component: GuildContributionManage
        },
        {
          path: 'guild-diplomacy-manage',
          name: 'guild-diplomacy-manage',
          component: GuildDiplomacyManage
        },
        {
          path: 'work-order-manage', // 工单管理路由
          name: 'work-order-manage',
          component: WorkOrderManage
        },
        {
          path: 'knowledge-base-manage', // 新增知识库管理路由
          name: 'knowledge-base-manage',
          component: KnowledgeBaseManage
        },
        {
          path: 'player-compensation-manage',
          name: 'player-compensation-manage',
          component: PlayerCompensationManage
        },
        {
          path: 'player-ban', // 新增
          name: 'player-ban',
          component: PlayerBan
        }
      ]
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    }
  ]
});

export default router;